
import {Injectable} from "@angular/core";
import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree, Router } from '@angular/router';
import { Observable } from 'rxjs';
// import {AuthService} from "../service/AuthService";

@Injectable({
  providedIn:'root'
})
export class MyDiskGuard implements CanActivate{
  constructor(private router: Router) { }
  // route: ActivatedRouteSnapshot,  如果有错的话，试着改下这个地方
  token: string | undefined;
  canActivate(
    next: ActivatedRouteSnapshot,
    state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
    console.log("DiskGuard canActivate")
    return true;
  }

}
